// app.js
import {
  getOpenID
} from "./api/getApi.js"
App({
  onLaunch() {

    wx.login({
      success: res => {
        getOpenID(res.code).then(res=>{
          wx.setStorageSync('openId', res)
        })
      }
    })  

    const userDataArray = [
      {
          "name": "瀚",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/FiOP2ln-7hEUCkFGDmr5Bw7MTwyz.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "头孢（传道授业解惑）",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/FtTPM7cUFRmEiZ0rBXiAyjYru6v4.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "饮老酒.",
          "avatarUrl": "https://img3.tapimg.com/avatars/2e719245b9249733f81ba7dacb959fb9.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "安安不吃芹菜",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/Fq_W1Ddn7eWqPH7kHWYhiWxJxN6_.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "gv&eeugjc",
          "avatarUrl": "https://img3.tapimg.com/default_avatars/0222bbb6df946833752c1ae27481533b.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "😒",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/FmHUcZQGTIusZEJVDgEC3OXWKnZm.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "hane_05",
          "avatarUrl": "https://img3.tapimg.com/default_avatars/352f55a11fb42a61eb0a1d0b7fa626dd.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "梦梦星",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/FhketUPleM4csZeMcRuuDIozBg4B.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "͜✿҉無ღ҉",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/FvkOweEkYeOEEckRDsgavTYCHZKy.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "無",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/Flgscwga6vEZ9gpmJdb1gcnvc0qj.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "战裔战裔",
          "avatarUrl": "https://img3.tapimg.com/third_avatars/7eba768dc370191a2089a4c68ce86c47.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "User22168853",
          "avatarUrl": "https://img3.tapimg.com/avatars/47aedd5c315a8c6644ebcbd08835490f.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "此千山",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/Fo4-JYZqd15RkNg3kbuXQ_JwexqG.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "胡靖宇",
          "avatarUrl": "https://img3.tapimg.com/default_avatars/2e37ca25ddfc668fe5ef1265689e5868.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "宇宙第一美少女",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/FlU3NT65IVkZ_OOLIlYTvQT_JUc7.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "英勇的沈家军",
          "avatarUrl": "https://img3.tapimg.com/default_avatars/8d7b8d6bfdbafca5212ba9ab29320611.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "incubator",
          "avatarUrl": "https://img3.tapimg.com/default_avatars/2e37ca25ddfc668fe5ef1265689e5868.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "繁华落尽、散一地",
          "avatarUrl": "https://img3.tapimg.com/avatars/7184ad5bceb34bb0ed4a16a6e6236678.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "懵懂",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/FreeD32_q_0trKO-C3VRRu6PA4ky.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "依依不舍",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/FlM3EGi8QDbX6yMxdYLsZe9sLDS8.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "陈陈相依",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/FlM3EGi8QDbX6yMxdYLsZe9sLDS8.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "狂野大锅2024大赏",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/FhWuZ8c0Miz0xXhPmL5wkkscnCmQ.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "酱油",
          "avatarUrl": "https://img3.tapimg.com/third_avatars/478af6d24cd7c1ef2df190d748981a46.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "起风",
          "avatarUrl": "https://img3.tapimg.com/third_avatars/b371856a384ea1ad09e2b78004f3544c.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "你可以叫我高贵的蓝批",
          "avatarUrl": "https://img3.tapimg.com/default_avatars/18862c33597d5ed964e1c358674fdc77.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "穗穗",
          "avatarUrl": "https://img3.tapimg.com/default_avatars/633e35840ad3dae791bd82faac207344.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "平平安",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/FtO8C6yjQCH_TJdSZHNnKXj7ZhWm.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "云深",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/FtO8C6yjQCH_TJdSZHNnKXj7ZhWm.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "不再褪色的雨",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/FmN7CAoOxyhaW89spB5WVKpRTbir.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "谨言慎行",
          "avatarUrl": "https://img3.tapimg.com/third_avatars/7da4dd687eb9f5c541085cc3becb6270.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "弦有别离音",
          "avatarUrl": "https://img3.tapimg.com/default_avatars/633e35840ad3dae791bd82faac207344.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "省外无影",
          "avatarUrl": "https://img3.tapimg.com/default_avatars/633e35840ad3dae791bd82faac207344.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
          "name": "弟弟法编辑部替补",
          "avatarUrl": "https://img3.tapimg.com/avatars/etag/FkqaO8IbDqlI32RvattR3fVOUCZS.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
        "name": "爱吃苹果",
        "avatarUrl": "https://img3.tapimg.com/avatars/etag/FkqaO8IbDqlI32RvattR3fVOUCZS.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
        "name": "抚昔",
        "avatarUrl": "https://img3.tapimg.com/default_avatars/384aa197eceba6322c9af740d008e65e.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
        "name": "User110211869",
        "avatarUrl": "https://img3.tapimg.com/default_avatars/aab3314fac8cb852d0d7424ce6739180.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
        "name": "无聊的",
        "avatarUrl": "https://img3.tapimg.com/default_avatars/28e29db066c967a5a1d98325eccdf85c.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
        "name": "风致",
        "avatarUrl": "https://img3.tapimg.com/default_avatars/58b4839ff36afc0207989182e6ea25c8.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
        "name": "社恐仙人",
        "avatarUrl": "https://img3.tapimg.com/default_avatars/f394aac79bfc4bfa73c69b62b4d035a9.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
        "name": "冉诚诚",
        "avatarUrl": "https://img3.tapimg.com/default_avatars/87f304ec1f0f3ee5b445fa0454193447.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
        "name": "沈焕溪",
        "avatarUrl": "https://img3.tapimg.com/avatars/etag/FgCWVJ9GyNeGAKC2PQeSPzxVOOjr.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
        "name": "空想",
        "avatarUrl": "https://img3.tapimg.com/third_avatars/17ead3b455f9225bb51913bf42602bd6.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
        "name": "嘿嘿嘿",
        "avatarUrl": "https://img3.tapimg.com/default_avatars/0222bbb6df946833752c1ae27481533b.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
        "name": "花卷云舒",
        "avatarUrl": "https://img3.tapimg.com/avatars/etag/FktwpnRin8OBMMwcT9SjDdHimUDy.png?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
      {
        "name": "吾",
        "avatarUrl": "https://img3.tapimg.com/default_avatars/aab3314fac8cb852d0d7424ce6739180.jpg?imageMogr2/auto-orient/strip/thumbnail/!180x180r/gravity/Center/crop/180x180/format/jpg/interlace/1/quality/40"
      },
    ]
    let randomIndex = Math.floor(Math.random() * userDataArray.length);
    let randomItem = userDataArray[randomIndex];
    randomItem.name=randomItem.name+Math.floor(Math.random() * 99);
    randomItem.userId=Math.floor(Math.random() * (99+Math.random()*231))*Math.floor(Math.random() * (99+Math.random()*187))+Math.floor(Math.random() * 99)+Math.floor(Math.random() * 1070231);
    if(!wx.getStorageSync('userData')){
      wx.setStorageSync('userData', JSON.stringify(randomItem))
    }
  },
  globalData: {
    userInfo: null
  }
})
